
    function calculateTax() {
    // 获取输入的收入金额
    var income = parseFloat(document.getElementById("income").value);

    // 创建请求对象
    var request = {
    income: income
};

    // 发送POST请求到后端
    $.ajax({
    url: "/income-tax",
    type: "POST",
    contentType: "application/json",
    data: JSON.stringify(request),
    success: function(response) {
    // 显示计算结果
    var resultElement = document.getElementById("result");
    resultElement.innerHTML = "个人所得税金额：" + response.taxAmount;
},
    error: function() {
    alert("计算个人所得税时发生错误。");
}
});
}
